package com.chris.blog.service.impl;

import com.chris.blog.dao.DownloadDao;
import com.chris.blog.entity.po.DownloadPO;
import com.chris.blog.service.DownloadService;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;
import java.util.List;

@Service
public class DownloadServiceImpl implements DownloadService {

    @Resource
    private DownloadDao downloadDAO;

    @Transactional(rollbackFor = Exception.class)
    @Override
    public int insert(DownloadPO record) {
        return downloadDAO.insert(record);
    }

    @Transactional(rollbackFor = Exception.class)
    @Override
    public int insertSelective(DownloadPO record) {
        return downloadDAO.insertSelective(record);
    }

    public List<DownloadPO> selectAllDesc() {
        return downloadDAO.selectAllDesc();
    }
}
